/**
 * Dear programmer:
 * When I wrote this code, only god and I knew how it worked.
 * Now, only god knows it!
 *
 * @author: Pegasus  Date: 2019-02-20 Time: 23:47
 */

import {Action} from "../../../configuration/ActionCreator"

export const SetToken = 'SetToken';
export const doSetToken = (token) => dispatch => {
  let action = Action(SetToken);
  action.token = token;
  return dispatch(action);
}

export const ClearToken = 'ClearToken';
export const doClearToken = () => dispatch => {
    let action = Action(ClearToken);
    return dispatch(action);
}

export const SetUserSession='SetUserSession';
export const doSetUserSession = (userid,dep,hotelId) => dispatch => {
    let action = Action(SetUserSession);
    action.userid = userid;
    action.dep = dep;
    action.hotelId = hotelId;
    return dispatch(action);
};


/**
 * 获取数据
 * @hotelId {string}
 */
export const SetCache='SetCache';
export const doSetCache = (cache) => dispatch =>  {
    let action = Action(SetCache);
    action.cache = cache;
    return dispatch(action);
}


